Page({
  data: {
    winWidth: 0,
    winHeight: 0,
    currentTab: 0,

    evaluate_list: [],
    type: 0,
    page: 1,
    no_more: !1,
    loading: !1,
    scrollHeight: 0,
  },
  onLoad: function () {

    var that = this;

    that.loadList();

    /**
     * 获取当前设备的宽高
     */
    wx.getSystemInfo({

      success: function (res) {
        that.setData({
          winWidth: res.windowWidth,
          winHeight: res.windowHeight
        });
      }

    });
  },

  onShow: function () {
        this.setData({
          scrollHeight: wx.getSystemInfoSync().windowHeight - (wx.getSystemInfoSync().windowWidth / 750 *100)
        })
  },

  //  tab切换逻辑
  swichNav: function (e) {

    var that = this;

    if (this.data.currentTab === e.target.dataset.current) {
      return false;
    } else {
      that.setData({
        currentTab: e.target.dataset.current,
        type:  e.target.dataset.current,
        page: 1,
        evaluate_list: [],
        no_more: !1,
        loading: !1,
      })
      that.loadList();
    }
  },

  loadList: function(t) {
  
    var a = this;
    a.data.no_more ? "function" == typeof t && t() : a.data.loading || (a.setData({
        loading: !0
    }), getApp().request({
        url: getApp().api.default.evaluate_center,
        data: {
            type: a.data.type,
            page: a.data.page
        },
        success: function(t) {
            if (0 == t.code) {
                if (!t.data.list || !t.data.list.length) return void a.setData({
                    no_more: !0,
                });
                a.data.evaluate_list || (a.data.evaluate_list = []), a.data.evaluate_list = a.data.evaluate_list.concat(t.data.list), 
                a.setData({
                    evaluate_list: a.data.evaluate_list,
                    page: a.data.page + 1,
                    not_evaluate_num: t.data.not_evaluate_num,
                    all_evaluate_num: t.data.all_evaluate_num,
                });
            }
        },
        complete: function() {
            a.setData({
                loading: !1
            }), "function" == typeof t && t();
        }
    }));
},
onReachBottom: function() {
  console.log(123);
  this.loadList();
},

  bindChange: function (e) {

    var that = this;
    that.setData({ currentTab: e.detail.current });

  },

  toEvaluate:function(e){
    getApp().core.navigateTo({
      url: '/pages/order-comment/order-comment?id=' + e.currentTarget.dataset.id
    });

  },

  // 商品导航
  navigatorGoods:function(e){
    getApp().core.navigateTo({
      url: '/pages/goods/goods?id=' + e.currentTarget.dataset.id
    });
  },
  
})